The Money Changing Problem Revisited: Computing the Frobenius Number in Time O(k a1)

نویسندگان

  • Sebastian Böcker
  • Zsuzsanna Lipták
چکیده

The Money Changing Problem is as follows: Let a1 < a2 < · · · < ak be fixed positive integers with gcd(a1, . . . , ak) = 1. Given some integer n, are there non-negative integers x1, . . . , xk such that ∑ i aixi = n? The Frobenius number g(a1, . . . , ak) is the largest integer n such that the above problem has no decomposition x1, . . . , xk. There exist algorithms that, for fixed k, compute the Frobenius number in time polynomial in log ai. For variable k, one can compute a residue table of a1 words which, in turn, allows to determine the Frobenius number. The best known algorithm for computing the residue table has runtime O(k a1 log a1) using binary heaps, and O(a1(k+ log a1)) using Fibonacci heaps. In both cases, O(a1) extra memory in addition to the residue table is needed. Here, we present an intriguingly simple algorithm to compute the residue table in time O(k a1) and extra memory O(1). In addition to computing the Frobenius number, we can use the residue table to solve the given instance of the Money Changing Problem in constant time, for any n.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An extension of the Frobenius coin - exchange problem

Given a set of positive integers A = {a1, . . . , ad} with gcd(a1, . . . , ad) = 1, we call an integer n representable if there exist nonnegative integers m1, . . . ,md such that n = m1a1 + · · ·+mdad . In this paper, we discuss the linear diophantine problem of Frobenius: namely, find the largest integer which is not representable. We call this largest integer the Frobenius number g(a1, . . . ...

متن کامل

An extension of the Frobenius coin - exchange problem 1 Matthias Beck and Sinai Robins 2 Dedicated to the memory of

Given a set of positive integers A = {a1, . . . , ad} with gcd(a1, . . . , ad) = 1, we call an integer n representable if there exist nonnegative integers m1, . . . ,md such that n = m1a1 + · · ·+ mdad . The linear diophantine problem of Frobenius asks for the largest integer which is not representable. We call this largest integer the Frobenius number g(a1, . . . , ad). One fact which makes th...

متن کامل

Sweep Line Algorithm for Convex Hull Revisited

Convex hull of some given points is the intersection of all convex sets containing them. It is used as primary structure in many other problems in computational geometry and other areas like image processing, model identification, geographical data systems, and triangular computation of a set of points and so on. Computing the convex hull of a set of point is one of the most fundamental and imp...

متن کامل

Efficient Computation of the Number of Solutions of the Linear Diophantine Equation of Frobenius with Small Coefficients

In this paper we present a novel approach for computing the number of solutions of the linear diophantine equation of Frobenius a1·x1 + ... + aN·xN = T when the coefficients a1, ..., aN are small. The proposed algorithm has a time complexity of the order of O(N·S·log(T)), where S=a1+...+aN. The algorithm can also be implemented to run in O(S·log(S)·log(T)+N·S) time, which is more efficient when...

متن کامل

The Polynomial Part of a Restricted Partition Function Related to the Frobenius Problem

Given a set of positive integers A = {a1, . . . , an}, we study the number pA(t) of nonnegative integer solutions (m1, . . . ,mn) to ∑n j=1mjaj = t. We derive an explicit formula for the polynomial part of pA. Let A = {a1, . . . , an} be a set of positive integers with gcd(a1, . . . , an) = 1. The classical Frobenius problem asks for the largest integer t (the Frobenius number) such that m1a1 +...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2005